<?php
header("Expires: Mon, 26 Jul 1970 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/html; charset=utf-8");
//error_reporting(0);
date_default_timezone_set('PRC');
define('EZROOT', str_replace(DIRECTORY_SEPARATOR,'/',dirname(dirname(__FILE__))));

define('PHP_EXIT','<?php exit;?>');
define('PHP_EXIT_PREG','<\?php exit;\?>');
define('DOMAIN_PREG',"/[\x80-\xff\w-]+\.(com|net|org|gov|la|cc|biz|info|cn|tk|mobi|co|so|tel|tv|name|asia|me|pk|in|ru|vc|sc|cd|gd|cm|hk|li|om|us|vn|pro|中国|公司|网络)((\.cn|\.hk|))$/");
define('CHARSET','UTF-8');

$mod=isset($_GET['mod'])?$_GET['mod']:'index'; //当前模块
$act=isset($_GET['act'])?$_GET['act']:'index'; //当前行为
if(is_array($act)){$act="index";}
if(is_array($mod)){$mod="index";}
define('MOD',$mod);
define('ACT',$act);
define('TODAY',date('Ymd'));
define('TIME',time());


session_start();
$sessionid=session_id();
include (EZROOT . '/data/conn.php');

include_once (EZROOT . '/libs/ez.class.php');
include_once(EZROOT . '/libs/comm.func.php');
include_once(EZROOT . '/libs/ez.func.php');
include_once(EZROOT . '/libs/mod.func.php');

include_once(EZROOT . '/libs/thumb.class.php');
include_once(EZROOT . '/libs/page.class.php');




$ezhand = new myezclass();
define('VERSION','20131001');
$ezhand->dbserver=$dbserver;
$ezhand->dbuser=$dbuser;
$ezhand->dbpass=$dbpass;
$ezhand->dbname=$dbname;
$ezhand->TABLEPRE=TABLEPRE;
$ezhand_link=$ezhand->connect();


if(!defined('ADMIN')){

    $webset=ez_get_cache('webset');
    
    if(empty($webset)){  //个别网站配置文件没了
        $ezhand->webset();
        $webset=ez_get_cache('webset');
    }
}else{
	$webset=$ezhand->webset(200);
	$ezhand->webset=$webset;
}
define('SITENAME',$webset["sitename"]);
define('URL',$webset["url"]);
define('SITEURL', 'http://'.URL.'');

$MOBAN="default";
define('TPLPATH',EZROOT.'/template/'.$MOBAN);
define('TPLURL','template/'.$MOBAN);


$userlogininfo = unserialize(get_cookie('userlogininfo'));

define('JSURL',SITEURL.'/'.TPLURL."/js");
define('CSSURL',SITEURL.'/'.TPLURL."/css");
define('IMGURL',SITEURL.'/'.TPLURL."/images");


$ProvinceList=array(
551=>"安徽",
100=>"北京",
591=>"福建",
931=>"甘肃",
200=>"广东",
771=>"广西",
851=>"贵州",
898=>"海南",
311=>"河北",
371=>"河南",
451=>"黑龙江",
270=>"湖北",
731=>"湖南",
431=>"吉林",
250=>"江苏",

791=>"江西",
240=>"辽宁",
471=>"内蒙古",
951=>"宁夏",
971=>"青海",
531=>"山东",
351=>"山西",
290=>"陕西",
210=>"上海",
280=>"四川",
220=>"天津",
891=>"西藏",
991=>"新疆",
871=>"云南",
571=>"浙江",
230=>"重庆"
);
$jobtype=array(0=>"全职",1=>"兼职",2=>"均可");

$sextype=array(0=>"男",1=>"女",2=>"不限");

/**
 * 友好打印
 * @param type $arr
 * @param type $flag
 */
if (!function_exists('pp')) {
    function pp($obj = __LINE__, $flag = 0)
    {
        //0 print_r 2var_dump 4json 6text 8htmlspecialchars
        $ishtml = ($flag == 6 || $flag == 7) ? FALSE : TRUE;
        $obj = is_object($obj) ? objectToArray($obj) : $obj;
        if ($ishtml)
            echo '<pre><div style="background:#fff;color:#000;border:1px dashed #f00;padding:20px;">';

        switch ($flag) {

            case 0:
            case 1:
                print_r($obj);
                break;
            case 2:
            case 3:
                var_dump($obj);
                break;
            case 4:
            case 5:
                print_r(json_encode($obj));
                break;
            case 6:
            case 7:
                $dirname = 'ptestlog';
                if (!is_dir($dirname)) {
                    mkdir($dirname);
                }
                date_default_timezone_set('Asia/Shanghai');
                $filename = $dirname . '/' . date('YmdHis') . '.txt';
                file_put_contents($filename, json_encode($obj));
                //file_put_contents($filename, print_r($obj,TRUE));
                break;
            case 8:
            case 9:
                print_r(array_htmlspecialchars($obj, ENT_QUOTES));
                break;
            default :
                print_r($obj);
                break;
        }
        $e = $ishtml == TRUE ? '</div></pre>' : '';
        if ($flag % 2 == 1) {
            exit($e);
        } else if ($ishtml) {
            echo $e;
        }
    }
}










?>